{extend name="ashippingterminal/Public/base" /}
{block name="container"}
<!-- 标题 -->
<div class="page-heade">
    <h2 class="title_color text-center">导购销售目标异动导入</h2>
</div>
<!-- 标题 -->
<form action="{:url('importform')}" id="form1" method="post" enctype="multipart/form-data" target="target_iframe">
<table class="table table-bordered text-center bud_hei" style="margin-bottom: 0">
    <tr>
        <td style="min-width: 160px;width: 160px">主题：</td>
        <input type="hidden" name="state" id="state" value="">
        <input type="hidden" name="theme" value="{$data.theme}">
        <td class="text-left" colspan="5">{$data.theme}</td>
    </tr>
    <tr>
        <td style="min-width: 160px;width: 160px">财年</td>
        <input type="hidden" name="year" value="{$data.year}">
        <td class="text-left">{$data.year}</td>
        <td style="min-width: 160px;width: 160px">编号</td>
        <input type="hidden" name="oldID" value="{$data.id}">
        <input type="hidden" name="oldNo" value="{$data.no}">
        <td class="text-left">{$data.no}</td>
        <td style="min-width: 160px;width: 160px">原申请编号</td>
        <td class="text-left"><a href="{:url('ashippingterminal/info')}?id={$data.oldID}">{$data.oldNo}</a></td>
    </tr>

</table>
<table class="table table-bordered" style="margin:1px 0">
    <tr>
        <td><a onclick='window.open("/index/ashippingterminal/export?id="+{$data.id},"_self")' class="btn btn-primary btn-sm">导出导购销售目标明细数据</a></td>
    </tr>
</table>
<table class="table table-bordered text-center bud_hei">
    <tr class="info">
        <td>No.</td>
        {volist name="title" id="vo"}
        <td>{$vo}</td>
        {/volist}
    </tr>
    <?php foreach($tmp as $key => $val){ ?>
    <tr>
        <td><?php echo $key+1; ?></td>
        <?php foreach($val as $k => $v){ ?>
        <td <?php if($k == 'money'){ echo 'class="ObjectNum">'.$v;}else{echo '>'.$v;} ?></td>
        <?php } ?>
    </tr>
    <?php } ?>
</table>
<table class="table table-bordered">
    <tr>
        <td>选择导入文件：<input type="file" name="file" id="exampleInputFile" class="validate[required]" style="display: inline-block;"> <span class="lr_5"></span></td>
    </tr>
    <tr>
        <td>
            <p class="colorRed">温馨提示：如果导入过程中出现未满足指掌天下系统要求数据，则整份导入资料都将无法导入，必须按照指掌天下系统给出的信息提示修改导入资料后再重新导入。</p>
            <p class="padding-10 font-bold">Excel文件导入注意事项：</p>
            <p>1.请仔细阅读下面的市场费用预算数据导入格式。并按照注意事项填入正确的数据。</p>
            <p class="padding-10">2.若设置一级考核期，则一级考核期不能为空，且必须是指掌天下中已存在的一级考核期。</p>
            <p>3.若设置二级考核期，则二级考核期不能为空，且必须是指掌天下系统中已存在的二级考核期。</p>
            <p class="padding-10">4.若设置品牌，则品牌不能为空，且必须是指掌天下中已存在的品牌。</p>
            <p>5.若设置品类，则品类不能为空，且必须是指掌天下中已存在的品类。</p>
            <p class="padding-10">6.若设置系列，则系列不能为空，且必须是指掌天下中已存在的品系列。</p>
            <p>7.若设置SKU，则SKU不能为空，且必须是指掌天下中已存在的SKU。</p>
            <p class="padding-10">8.若设置单品，则单品不能为空，且必须是指掌天下中已存在的单品。</p>
            <p>9.若设置网点，则网点不能为空，且必须是指掌天下中已存在的网点。</p>
            <p><span class="font-bold">Excel文件导入格式：</span><a onclick="excel()">导购目标导入格式.xls</a><span class="colorRed">注：Excel中标记为红色底色的列为必填项。</span></p>
        </td>
    </tr>
</table>
<div class="padding-10 text-center">
    <button class="btn btn-success" onclick="primary(0)">保存草稿</button><span class="lr_5"></span><button class="btn-primary btn" onclick="primary(1)">提交</button><span class="lr_5"></span><button class="btn btn-warning" type="button" onclick="back()">返回</button>
</div>
</form>
<iframe name="target_iframe" style="display:none"></iframe>
<script>
    $('#form1').validationEngine('attach', {
        promptPosition: 'bottomRight'
    });
    function primary(type){
        if(type == 0){
            $('#state').val("草稿");
        }else{
            $('#state').val("已提交");
        }
        $('form1').submit();
    }
    //下载模板
    function excel() {
        location.href='/index/ashippingterminal/makeExcel?year='+"{$data['year']}";
    }
    $(document).ready(function(){
        var $ObjectNum =$(".ObjectNum");
        toNum($ObjectNum);
    })
    function back(){
        history.go(-1)
    }
</script>
{/block}
